package com.ibeifeng.crm.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ibeifeng.crm.bean.User;
import com.ibeifeng.crm.dao.UserFindDao;
import com.ibeifeng.crm.service.UserFindService;

@Service
public class UserFindServiceImpl implements UserFindService {
	@Resource
	UserFindDao userFindDao;
	@Override
	public User get(String userCode) {
		return userFindDao.findUserByUsreCode(userCode);
	}

	@Override
	public Map<String, Object> listAuthByUserCode(String userCode) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("allRoles", userFindDao.findAllRoleByUsreCode(userCode));
		map.put("allPermission", userFindDao.findAllPermissionByUsreCode(userCode));
		return map;
	}

}
